<template>
    <div class="head">
        <div class="left">
            <img src="@/assets/logo.png" alt="">
            <h1>学生信息 成绩管理平台</h1>
        </div>
        <div class="right">
            <div class="list">

                <li>
                    <router-link :to="{ path: '/problem' }">
                        常见问题
                    </router-link>
                </li>
                <li>
                    <router-link :to="{ path: '/security' }">
                        安全中心
                    </router-link>
                </li>
                <li>
                    <router-link :to="{ path: '/security' }">
                        客服
                    </router-link>
                </li>

                <li>
                    <router-link :to="{ path: '/login' }">
                        {{ info }}
                    </router-link>
                </li>
                <li @click="exit">
                    退出
                </li>
            </div>
        </div>

    </div>
</template>

<script>
export default {
    computed: {
        info() {
            return this.$store.state.user_name ? this.$store.state.user_name : '登录';
        },
    },
    methods: {
        exit() {
            localStorage.clear();
            sessionStorage.clear();
            window.open("about:blank", "_self");
            window.close();
        }
    }
}
</script>

<style lang="scss" scoped>
.head {
    display: flex;
    justify-content: space-between;

    .left {
        display: flex;
        align-items: center;

        img {
            width: 60px;
            height: 100%;
            border-radius: 50%;
        }
    }

    .right {
        width: 40%;
        align-items: center;

        .list {
            display: flex;
            justify-content: space-around;
            align-items: center;

        }
    }
}
</style>